using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System;
//U001
public class MagicMenu
{
    [MenuItem("MagicMenu/Unity中文文档")]
    private static void MenuFunction_OpenChineseUserManual()
    {
        var window = EditorWindow.GetWindow<ManualSerchWindow>(false, "文档搜索");
        window.minSize = new Vector2(220, 160);
        window.maxSize = new Vector2(220, 160);
    }
    [MenuItem("Assets/MagicMenu/CreatScriptIntance", false, 1)]
    private static void MenuFunction_CreatScriptIntance()
    {
        //TODO:根据选择的资源的类型,屏蔽菜单
        MonoScript script = (MonoScript)Selection.activeObject;
        GameObject go= new GameObject($"#{script.name}");
        go.AddComponent(script.GetClass());
    }

    [MenuItem("Assets/MagicMenu/New Test Scene", false, 2)]
    private static void CreatNewTestFolder()
    {
        var window = EditorWindow.GetWindow<NewSceneWindow>(false, "新建场景");
        window.minSize = new Vector2(220, 160);
        window.maxSize = new Vector2(220, 160);
    }

    [MenuItem ("Assets/MagicMenu/C#Script #&S",false,3)]
    public static void OpenCreatCriptWindow()
    {
        var window = EditorWindow.GetWindow<CreatScriptWindow>(true, "创建C#脚本");
        window.minSize = new Vector2(220, 160);
        window.maxSize = new Vector2(220, 160);
    }

    [MenuItem("MagicMenu/OpenGeneralWindow")]
    public static void OpenGeneralWindow()
    {
        var window = EditorWindow.GetWindow<MagicMenuGeneralWindow>(true, "GenerMenu");
       //window.minSize = new Vector2(220, 160);
       //window.maxSize = new Vector2(220, 160);
    }

    [MenuItem("GameObject//MagicMenu/Creat/Cube", false ,-3)]
    public static void CreatCube()
    {
        MagicMenuHelper.CreatePrimitive(PrimitiveType.Cube, "Cube", 0.5f);
    }
    [MenuItem("GameObject//MagicMenu/Creat/Capsule", false, -2)]
    public static void CreatCapsule()
    {
        MagicMenuHelper.CreatePrimitive(PrimitiveType.Capsule, "Capsule", 1f);
    }
    [MenuItem("GameObject//MagicMenu/Creat/Sphere", false, -1)]
    public static void CreatSphere()
    {
        MagicMenuHelper.CreatePrimitive(PrimitiveType.Sphere,"Sphere",0.5f);
    }

    [MenuItem("GameObject/MagicMenu/Copy/AllSelectedName", false, -1)]
    public static void CopyAllSelectedName()
    {
        MagicMenuHelper.CopyAllSelectedName();
    }
    [MenuItem("GameObject/MagicMenu/Copy/AllSelectedPath", false, -1)]
    public static void CopyAllSelectedPath()
    {
        MagicMenuHelper.CopyAllSelectedPath();
    }

}

